docker run -itd --name ubuntu_apache_php -p 80:80 ubuntu:24.04 bin/bash #When you use docker attach, the container stops when you exit. docker exec -it ubuntu_apache_php /bin/bash apt update apt install -y software-properties-common #noninteractive is required in the Dockerfile. add-apt-repository ppa:ondrej/php apt update apt-get install -y unzip wget vim apt-get install -y apache2 apt-get install -y php7.4 apt-get install -y php-mbstring php-gd php-curl php-xml php-mysql apt-get install -y php7.4-mysqli sed -i 's/;date.timezone =/date.timezone = Asia\/Seoul/g' /etc/php/7.4/apache2/php.ini sed -i 's/;date.timezone =/date.timezone = Asia\/Seoul/g' /etc/php/7.4/cli/php.ini sed -i 's/short_open_tag = Off/short_open_tag = On/g' /etc/php/7.4/apache2/php.ini sed -i 's/short_open_tag = Off/short_open_tag = On/g' /etc/php/7.4/cli/php.ini wget https://web-server-source.s3.ap-northeast-2.amazonaws.com/basic_php7_Load.zip mkdir /var/www/html/basic unzip basic_php7_Load.zip -d /var/www/html/basic wget https://web-server-source.s3.ap-northeast-2.amazonaws.com/index.html cp index.html /var/www/html/ wget https://web-server-source.s3.ap-northeast-2.amazonaws.com/index.php cp index.php /var/www/html/ chmod 0777 /var/www/html/basic/data service apache2 start or /etc/init.d/apache2 start Edit /var/www/html/basic/login/dbconn.php